UNAME = $(shell uname)

AR_HOME = ../../..
AR_CPPFLAGS = -I$(AR_HOME)/include

VRML_HOME = /usr
ifeq "$(UNAME)" "Darwin"
	VRML_HOME = /sw
endif
VRML_CPPFLAGS = -I$(VRML_HOME)/include/openvrml -I/usr/X11R6/include

CPPFLAGS = $(AR_CPPFLAGS) $(VRML_CPPFLAGS)
CFLAGS = -O -I/usr/X11R6/include -DUSE_EYETOY -I/usr/src/linux-headers-2.6.35-25-generic/include -I/usr/src/linux-headers-2.6.35-25-generic/arch/x86/include
CXXFLAGS = -O -I/usr/X11R6/include -DUSE_EYETOY -I/usr/src/linux-headers-2.6.35-25-generic/include -I/usr/src/linux-headers-2.6.35-25-generic/arch/x86/include
AR = ar
ARFLAGS = rs
RANLIB = 

TARGET = $(AR_HOME)/lib/libARvrml.a

HEADERS = \
    $(AR_HOME)/include/AR/arvrml.h \
    arViewer.h

OBJS = \
	arViewer.o \
	arViewerCapi.o

# Implicit rule, to compile C++ files with the .cpp suffix (rule already exists for .cc).
%.o : %.cpp
	$(CXX) -c $(CPPFLAGS) $(CXXFLAGS) $< -o $@

default build all: $(TARGET)

$(OBJS): $(HEADERS)

$(TARGET): $(OBJS)
	$(AR) $(ARFLAGS) $@ $^
	$(RANLIB) $@ 

clean:
	-rm -f *.o *~ *.bak
	-rm $(TARGET)

allclean:
	-rm -f *.o *~ *.bak
	-rm $(TARGET)
	-rm -f Makefile
